#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
#include <QDir>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowTitle("窗口标题");
    this->setWindowIcon(QIcon(":/test.png"));
    QString currentDir = QDir::currentPath();
    QPushButton *button  = new QPushButton(this);


    button->setText("按钮");
    button->setCursor(QCursor(Qt::WaitCursor));
    ui->label->setCursor(QCursor(Qt::WaitCursor));
    float opacity = windowOpacity();

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    float opacity = windowOpacity();
    if(opacity < 1){
        opacity += 0.1;
        this->setWindowOpacity(opacity);
    }
}

void Widget::on_pushButton_2_clicked()
{
    float opacity = windowOpacity();
    if(opacity > 0){
        opacity -= 0.1;
        this->setWindowOpacity(opacity);
    }
}

void Widget::on_label_linkActivated(const QString &link)
{
    ui->label->setCursor(QCursor(Qt::WaitCursor));
}
